import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
import { Organization } from '@/modules/organization/models/organization.entity';
import { Product } from '@/modules/product/models/product.entity';
import { Student } from '@/modules/student/models/student.entity';

@Entity()
export class order {
  @PrimaryGeneratedColumn()
  id: number;

  @Column()
  outTradeNo: string;

  @Column()
  tel: string;

  @Column()
  quantity: number;

  @Column()
  amount: number;

  @Column()
  status: string;

  @ManyToOne(() => Organization, (Organization) => Organization.id)
  org: Organization;

  @ManyToOne(() => Product, (Product) => Product.id)
  product: Product;

  @ManyToOne(() => Student, (Student) => Student.id)
  student: Student;
}
